package com.yisu.auction.api.core.mapper;

import com.yisu.auction.api.domain.request.activityPackage.SecKillActivityRequest;
import com.yisu.auction.api.domain.request.memberPackage.LoginRequest;
import com.yisu.auction.api.domain.request.memberPackage.MemberInfoRequest;
import com.yisu.auction.api.domain.vo.memberPackageVos.MemberBaseInfoVo;
import com.yisu.auction.ewf.entity.Member;
import com.yisu.auction.api.domain.request.memberPackage.MemberRequest;
import org.apache.ibatis.annotations.Param;

public interface MemberMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Member record);

    int insertSelective(Member record);

    Member selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Member record);

    int updateByPrimaryKey(Member record);

    /**
     * author: 赵杰
     * Business Description：通过第三方帐号及appSign获取会员基本信息
     *
     * @param memberRequest thirdID ，appSign
     * @return 会员基本信息
     */
    Member getMemberByThirdIdAndAppSign(MemberRequest memberRequest);

    /**
     * author: 赵杰
     * Business Description：通过第三方帐号及appSign 检测用户是否存在
     *
     * @param memberRequest thirdID ，appSign
     * @return 会员基本信息
     */
    int checkMemberByThirdIdAndAppSign(MemberRequest memberRequest);

    /**
     * author: 赵杰
     * Business Description：更新用户积分
     * @param memberRequest
     * @return
     */
    int updateMemberIntegral(MemberRequest memberRequest);

    /**
     * author:黄萧林
     * Business Description:获取会员基本信息
     * @param memberRequest
     * @return
     */
    MemberBaseInfoVo getMemberBaseInfo(MemberRequest memberRequest);

    /**
     * author: 赵杰
     * Business Description：获取最大会员ID
     * @return 最大会员ID
     */
    Integer getMaxMemberId();


    /**
     * author: 赵杰
     * Business Description：扣除用户赠送的余额
     *
     * @param memberId 会员ID
     * @return
     */
    int deductPresentWallet(@Param("memberId") long memberId);

    /**
     * author: 赵杰
     * Business Description：扣除用户余额
     *
     * @param memberId 会员ID
     * @return
     */
    int deductWallet(@Param("memberId")long memberId);


    /**
     * author: 赵杰
     * Business Description：预冻结的信息  拍币  抢币
     * @param memberRequest
     * @return
     */
    int freezeWallet(MemberRequest memberRequest);


    int rechargeWallet(MemberRequest memberRequest);

    /**
     * author: 赵杰
     * Business Description：为秒杀业务获取虚拟用户
     * @return
     */
    long getVirtualMemberForSecKill(SecKillActivityRequest secKillActivityRequest);


    /**
     * 作者：赵杰
     * 业务：通过手机号码及密码获取用户信息
     * @param loginRequest 含会员手机号 密码
     * @return
     */
    Member getMemberByMobileAndPassword(LoginRequest loginRequest);

    /**
     * 作者：赵杰
     * 业务：通过手机号码
     * @param memberRequest 含会员手机号
     * @return
     */
    Member getMemberByMobile(MemberRequest memberRequest);

    /**
     * 作者：赵杰
     * 业务：更新用户累计消费金额
     * @param memberId
     * @return
     */
    int updateConsumptionAmount(long memberId);

    /**
     * author:黄萧林
     * Business Description:更新用户密码
     * @param memberInfoRequest
     * @return
     */
    int updateMemberPasswordForNoLogin(MemberInfoRequest memberInfoRequest);
}